<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var varname="varvalue";
    // 浏览器环境
    console.log(window.varname)
    // nodejs环境
    // console.log(global.varname)
    // 通用环境
    console.log(this.varname)

    let letname="letvalue";
    // 浏览器环境
    console.log(window.letname)
    // 通用环境
    console.log(this.letname)
</script>
</body>
</html>